<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" href="__CSS__/swiper-3.4.2.min.css"/>
    <link rel="stylesheet" href="__CSS__/common.css"/>
    <link rel="stylesheet" href="__CSS__/fsx.css"/>
    <link rel="shortcut icon" href="__IMG__/fsx0.ico">
    <style>
        html,body{width: 100%; height: 100%; overflow: hidden; }
    </style>
</head>
<body>
<div class="login_top">
    <!--nav-->
    <tc_include file="Home/Public/nav" />
    <!--nav end-->
</div>


<!--content-->
<div class="login_box">
    <div class="an-box">
        <div class="heighst"></div>
        <div class="an-cnnter">
            <div class="zhilogo"><img src="__IMG__/logo5.png" /></div>
            <div class="anlogo">樱空登录</div>
            <div class="anMode">
                <span class="animg"><img src="__IMG__/anicon1.png" alt=""/></span>
                <span class="aninput"><input class="tel" type="text" placeholder="账号"/></span>
            </div>
            <div class="anMode anMode2">
                <span class="animg"><img src="__IMG__/anicon2.png" alt=""/></span>
                <span class="aninput"><input class="ma" type="password" placeholder="密码"/></span>
            </div>
            <div class="anMode anMode2">
                <span class="animg"><img src="__IMG__/anicon3.png" alt=""/></span>
                <span class="aninput aninputym"><input class="yma" type="text" placeholder="验证码"/></span>
                <span class="anym"><img class="verify_img" src="{:U('Home/Register/loginVerify')}" onclick="this.src=this.src+'&time='+Math.random();" style="cursor: pointer;" title="点击获取"></span>
            </div>
            <div class="anMode anModebtn"><input type="button" onclick="send()" value="登录"/></div>
            <div id="msg"></div>

        </div>
    </div>
</div>
<!--content end-->
<div class="login_bot">
    <!--footer-->
    <tc_include file="Home/Public/footer" />
    <!--footer end-->
</div>

<script src="__JS__/jquery-1.10.1.min.js"></script>
<script src="__JS__/swiper-3.4.2.jquery.min.js"></script>
<script src="__JS__/fsx.js"></script>
<script>
    //窗口改变页面自动刷新 开始
    window.onresize=function(){
        location.reload();
    };
    $(".heighst").css("height",($(window).height()-$(".an-cnnter").outerHeight())/2);
    $(function(){
        $(".an-box").css("opacity",1);
    });


    function CheckEnterKey(evt)
    {
        if(evt.keyCode == 13)
        {
            send();
        }
    }
    function send(){
        var name = $(".tel").val();
        var pwd = $(".ma").val();
        var verify = $(".yma").val();

        if(name==""){
            $("#msg").html("<center><font color='red'>用户名不能为空</font></center>");
            return false;
        }if(pwd==""){
            $("#msg").html("<center><font color='red'>密码不能为空</font></center>");
            return false;
        }if(verify==""){
            $("#msg").html("<center><font color='red'>验证码不能为空</font></center>");
            return false;
        }
        $.ajax({
            type: "POST",
            url: "/index.php?g=Home&m=Register&a=doLogin",
            data: {'username':name,'password':pwd,'verify':verify},
            success: function(msg){
                if(msg==1){
                    $("#msg").html("<center><font color='red'>验证码不正确</font></center>");
                    return false;
                }
                if(msg==2){
                    $("#msg").html("<center><font color='red'>用户不存在</font></center>");
                    return false;
                }
                if(msg==3){
                    $("#msg").html("<center><font color='red'>密码不正确</font></center>");
                    return false;
                }
                if(msg==4){
                    $("#msg").html("<center><font color='red'>登录成功</font></center>");
                    window.location.href="?g=Home&m=Index&a=index";
                }
            }
        });
    }

</script>
</body>
</html>